package com.jerome.election.http;

import java.util.Map;

/**
 * HTTP Request object.
 * Represents an HTTP request with various attributes including method, URI, host, path, version, headers, and message.
 *
 * @author Jerome
 * @date 2023/8/5
 */
public class Request {
    /**
     * HTTP request method (e.g., GET, POST, PUT, DELETE, OPTIONS, etc.).
     */
    private String method;

    /**
     * The URI of the request, including path and query parameters.
     */
    private String uri;

    /**
     * The host part of the URL.
     */
    private String host;

    /**
     * The path part of the URL.
     */
    private String path;

    /**
     * HTTP version.
     */
    private String version;

    /**
     * Request headers.
     */
    private Map<String, String> headers;

    /**
     * Request message body.
     */
    private String message;

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Request() {
    }

    public Request(String method, String host, String uri, Map<String, String> headers, String message) {
        this.method = method;
        this.host = host;
        this.uri = uri;
        this.headers = headers;
        this.message = message;
    }
}
